﻿@using SmartCode
@using SmartCode.Db
@model BuildContext
@{
    var project = Model.Project;
    var dbSource = Model.GetDataSource<DbSource>();
    var table = Model.GetCurrentTable();
    var pkCol = table.PKColumn;
    var resultMapName = $"{table.ConvertedName}ResultMap";
}

<select id="getById" resultMap="@resultMapName">
    <bind name="id" value="_parameter"/>
    select * from @table.Name
    where @pkCol.Name=#{id}
    limit 1
</select>